<?php
$arr = [1,3,4,6,9,33,55,66,77,88,456];


	for ($i=0; $i < count($arr); $i++) 
	{ 
		$falg = false;
		for ($j=0; $j < count($arr)-$i-1; $j++) 
		{ 
			if($arr[$j]>$arr[$j+1])
			{
				$tmp = $arr[$j];
				$arr[$j] = $arr[$j+1];
				$arr[$j+1] = $tmp;
				$falg = true;
			}
		}
		if(!$falg)
		{
			break;
		}
	}
print_r($arr);

